package com.neu.envprotection.airQuality.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.neu.envprotection.airQuality.dao.entity.AirQuality;
import com.neu.envprotection.airQuality.dto.req.AirQualityReqDto;
import com.neu.envprotection.airQuality.dto.req.UserSelectReqDto;
import com.neu.envprotection.airQuality.dto.resp.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ${author}
 * @date 2024/06/07
 */
public interface AirQualityMapper extends BaseMapper<AirQuality> {
    List<AirQualityRespDto> selectAirQualityListById(@Param("user") UserSelectReqDto userSelectReqDto);
    Integer updateAirQualityByReq(@Param("air") AirQualityReqDto airQualityReqDto);
    List<AirQHistoryRespDto> getAirQHistoryById(@Param("user")UserSelectReqDto userSelectReqDto);
    //查询省aqi
    List<GetProvinceAQIRespDto> getProvinceAQI();
    List<GetAQIDistributionRespDto> getAQIDistribution();
    List<GetAQITrendRespDto> getAQITrend();

    @Select("select * from air_quality where feedback_id = #{feedbackId}")
    AirQuality getByFeedbackId(Integer feedbackId);
}
